import React, { PureComponent } from 'react'
import { Input, Space } from 'antd'
import './index.less'
import { SearchOutlined } from '@ant-design/icons'

const { Search } = Input

class HomeSearch extends PureComponent {

  enterButton = () => {
    return <Space>
      <SearchOutlined/>
      <span>搜索</span>
    </Space>
  }

  render () {
    const { onSearch } = this.props
    return (
      <Search
        placeholder="搜CSDN"
        allowClear
        enterButton={this.enterButton()}
        size="middle"
        onSearch={onSearch}
      />
    )
  }
}

export default HomeSearch
